#!/usr/bin/env python
# encoding: utf-8
"""
@author: youfeng
@email: youfeng243@163.com
@license: Apache Licence 
@file: generator.py
@time: 2016/12/13 17:03
"""
from parse.parse_anhui import prase_object_anhui
from parse.parse_beijing import prase_object_beijing
from parse.parse_chongqing import prase_object_chongqing
from parse.parse_guangdong import prase_object_guangdong
from parse.parse_hainan import prase_object_hainan
from parse.parse_heilongjiang import prase_object_heilongjiang
from parse.parse_henan import prase_object_henan
from parse.parse_hubei import prase_object_hubei
from parse.parse_hunan import prase_object_hunan
from parse.parse_jiangsu import prase_object_jiangsu
from parse.parse_liaoning import prase_object_liaoning
from parse.parse_ningxia import prase_object_ningxia
from parse.parse_qinghai import prase_object_qinghai
from parse.parse_shandong import prase_object_shandong
from parse.parse_shanxi import prase_object_shanxi
from parse.parse_shanxicu import prase_object_shanxicu
from parse.parse_sichuan import prase_object_sichuan
from parse.parse_tianjin import prase_object_tianjin
from parse.parse_xinjiang import prase_object_xinjiang
from parse.parse_xizang import prase_object_xizang

__all__ = ['prase_object_ningxia', 'prase_object_qinghai', 'prase_object_shandong', 'prase_object_shanxi',
           'prase_object_shanxicu', 'prase_object_anhui', 'prase_object_tianjin', 'prase_object_xinjiang',
           'prase_object_xizang', 'prase_object_sichuan', 'prase_object_beijing', 'prase_object_chongqing',
           'prase_object_guangdong', 'prase_object_hainan', 'prase_object_heilongjiang', 'prase_object_henan',
           'prase_object_hubei', 'prase_object_hunan', 'prase_object_jiangsu', 'prase_object_liaoning',
           ]


def create_object(config_dict):
    single_clazz = dict()
    single_clazz['province'] = config_dict.get('province', '')
    single_clazz['logfile'] = config_dict.get('logfile', '')
    single_clazz['source_table'] = config_dict.get('source_table', '')
    single_clazz['target_table'] = config_dict.get('target_table', '')

    clazz = 'prase_object_' + single_clazz['province']

    return eval(clazz)(**single_clazz)
